package view.micro
{
	import flash.display.Sprite;
	import model.macro.RangedWeapon;
	import model.macro.Weapon;
	
	/**
	 * ...
	 * @author Simon Baumgardt-Wellander
	 */
	public class WeaponSprite extends Sprite
	{
		private var weapon:Weapon;
		
		public function WeaponSprite(weapon:Weapon)
		{
			super();
			this.weapon = weapon;
			
			if (weapon is RangedWeapon)
			{
				if (weapon == RangedWeapon.CROSSBOW)
				{
					graphics.lineStyle(1.5, 0x774400);
					graphics.lineTo( -10, 0);
				}
				else
				{
					graphics.lineStyle(1.5, 0x774400);
					graphics.curveTo(-5, 5, 0, 10);
					graphics.lineStyle(0, 0xAAAAAA);
					graphics.lineTo(0, 0);
				}
			}
			else
			{
				var length:int;
				
				switch (weapon)
				{
					case Weapon.SWORD: 
						length = 10;
						break;
					case Weapon.HALBERD: 
						length = 20;
						break;
					default: 
						length = 10;
						break;
				}
				
				graphics.lineStyle(2, 0x777777);
				graphics.lineTo(0, length);
			}
		}
		
		public function update(attack_wait:int):void
		{
		}
		
		public function readyToRemove():Boolean
		{
			return false;
		}
	
	}

}